/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.controller;

import com.dp.dto.BaseDTO;
import com.dp.model.Books;
import com.dp.services.IItemServices;
import com.dp.services.ItemServices;
import com.dp.utils.BaseException;
import com.dp.dto.BookListDTO;
import java.util.List;

/**
 *
 * @author hisik
 */
public class BookListController {
    
    private static final IItemServices itemServices = new ItemServices();
    
    public static List<Books> loadBookList(BaseDTO dto) throws BaseException {
        return itemServices.loadBookList();
    }
    
    public static List<Books> getBooksByName(BookListDTO dto) throws BaseException {
        String bookName = dto.getBookName();
        return itemServices.getBooksByName(bookName);
    }
    
    public static void deleteBookByObjid(BookListDTO dto) throws BaseException {
        Long objid = dto.getObjid();
        itemServices.deleteBookByObjid(objid);
    }
}
